<?php

$str = "student. a am I";
$sum = ReverseSentence($str);
echo $sum;

function ReverSentence()
{
    $arr = str_split($str);
    $array = array();
    $k = 1;
    for($i=1;$i<=count($str);$i++)
    {

    }
}